﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MvcMusicStore.Models;

namespace MvcMusicStore.Repositories
{
    public class CartRepository
    {
        public MusicStoreEntities Context { get; private set; }
        public CartRepository(MusicStoreEntities ct)
        {
            Context = ct;
        }

        public List<Cart> GetAll()
        {
            throw new NotImplementedException();
        }

        public Cart GetById(int id)
        {
            throw new NotImplementedException();
        }

        public Cart GetByShoppingCartId(string id)
        {
            return Context.Carts.FirstOrDefault(s => s.ShoppingCartId == id);
        }

        public void Add(Cart item)
        {
            Context.Carts.Add(item);
        }

        public void Edit(Cart item)
        {
            throw new NotImplementedException();
        }

        public void Delete(int id)
        {
            throw new NotImplementedException();
        }

        public List<Cart> GetPager(int pageIndex, int pageSize)
        {
            throw new NotImplementedException();
        }
    }
}